BookControl
METADATA
Attribute | Value |
---|---|
Topic | 1630-client-book-risk |
MLink Token | ClientControl |
Product | SRControl |
accessType | SELECT,UPDATE,INSERT,DELETE |
Table Definition
Field | Type | Key | Default Value | Comment |
---|---|---|---|---|
accnt | VARCHAR(16) | PRI | '' | |
clientFirm | VARCHAR(16) | PRI | '' | SR client firm |
bookStatus | enum - BookStatus | 'TwoWay' | ||
bookRiskMultiplier | FLOAT | 1.0 | book risk multiplier xRM | |
maxAccHaircut | FLOAT | 1000000 | xRM max preexpiration target haircut 3750 | |
minAccRho | FLOAT | -1000 | minimum accnt rho ddInt | |
maxAccRho | FLOAT | +1000 | maximum accnt rho ddInt | |
minDDelta | INT | 1000000 | min accnt delta | |
maxDDelta | INT | 1000000 | max accnt delta | |
maxAccAbsWtVega | FLOAT | 10000 | xRM max account abs wtVega sum of abssymbol net wtVegawtVega ve vol sqrtmax01 years 4 | |
minAccWtVega | FLOAT | -1000 | xRM minimum accnt net wtVega | |
maxAccWtVega | FLOAT | +1000 | xRM maximum accnt net wtVega | |
minIndWtVega | FLOAT | -1000 | xRM minimum ind 0 net wtVega applies to each industry unless overriden by an IndustryControl record | |
maxIndWtVega | FLOAT | +1000 | xRM maximum ind 0 net wtVega applies to each industry unless overriden by an IndustryControl record | |
minSubWtVega | FLOAT | -1000 | xRM minimum sub 00 net wtVega applies to each subIndustry unless overriden by an IndustryControl record | |
maxSubWtVega | FLOAT | +1000 | xRM maximum sub 00 net wtVega applies to each subIndustry unless overriden by an IndustryControl record | |
minGrpWtVega | FLOAT | -1000 | xRM minimum grp 000 net wtVega applies to each indGroup unless overriden by an IndustryControl record | |
maxGrpWtVega | FLOAT | +1000 | xRM maximum grp 000 net wtVega applies to each indGroup unless overriden by an IndustryControl record | |
userText | TINYTEXT | '' | free form text | |
modifiedBy | VARCHAR(24) | '' | user who last modified this record | |
modifiedIn | enum - SysEnvironment | 'None' | ||
timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | timestamp of last modification |
PRIMARY KEY DEFINITION (Unique)
Field | Sequence |
---|---|
accnt | 1 |
clientFirm | 2 |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRControl`.`MsgBookControl` (
`accnt` VARCHAR(16) NOT NULL DEFAULT '',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`bookStatus` ENUM('Hold','TwoWay','BuyOnly','SellOnly','CloseOnly','CloseNow','CloseRisk','BuyCloseOnly','SellCloseOnly') NOT NULL DEFAULT 'TwoWay',
`bookRiskMultiplier` FLOAT NOT NULL DEFAULT 1.0 COMMENT 'book risk multiplier (xRM)',
`maxAccHaircut` FLOAT NOT NULL DEFAULT 1000000 COMMENT '(xRM) max pre-expiration target haircut ($37.50)',
`minAccRho` FLOAT NOT NULL DEFAULT -1000 COMMENT 'minimum accnt rho (d$/dInt)',
`maxAccRho` FLOAT NOT NULL DEFAULT +1000 COMMENT 'maximum accnt rho (d$/dInt)',
`minDDelta` INT NOT NULL DEFAULT 1000000 COMMENT 'min accnt $delta',
`maxDDelta` INT NOT NULL DEFAULT 1000000 COMMENT 'max accnt $delta',
`maxAccAbsWtVega` FLOAT NOT NULL DEFAULT 10000 COMMENT '(xRM) max account abs wtVega (sum of abs{symbol net wtVega});wtVega = ve * vol / sqrt(max(0.1, years * 4))',
`minAccWtVega` FLOAT NOT NULL DEFAULT -1000 COMMENT '(xRM) minimum accnt net wtVega',
`maxAccWtVega` FLOAT NOT NULL DEFAULT +1000 COMMENT '(xRM) maximum accnt net wtVega',
`minIndWtVega` FLOAT NOT NULL DEFAULT -1000 COMMENT '(xRM) minimum ind (0) net wtVega (applies to each industry unless overriden by an IndustryControl record)',
`maxIndWtVega` FLOAT NOT NULL DEFAULT +1000 COMMENT '(xRM) maximum ind (0) net wtVega (applies to each industry unless overriden by an IndustryControl record)',
`minSubWtVega` FLOAT NOT NULL DEFAULT -1000 COMMENT '(xRM) minimum sub (00) net wtVega (applies to each subIndustry unless overriden by an IndustryControl record)',
`maxSubWtVega` FLOAT NOT NULL DEFAULT +1000 COMMENT '(xRM) maximum sub (00) net wtVega (applies to each subIndustry unless overriden by an IndustryControl record)',
`minGrpWtVega` FLOAT NOT NULL DEFAULT -1000 COMMENT '(xRM) minimum grp (000) net wtVega (applies to each indGroup unless overriden by an IndustryControl record)',
`maxGrpWtVega` FLOAT NOT NULL DEFAULT +1000 COMMENT '(xRM) maximum grp (000) net wtVega (applies to each indGroup unless overriden by an IndustryControl record)',
`userText` TINYTEXT NOT NULL DEFAULT '' COMMENT 'free form text',
`modifiedBy` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'user who last modified this record',
`modifiedIn` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'timestamp of last modification',
PRIMARY KEY USING HASH (`accnt`,`clientFirm`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';
SELECT TABLE EXAMPLE QUERY
SELECT
`accnt`,
`clientFirm`,
`bookStatus`,
`bookRiskMultiplier`,
`maxAccHaircut`,
`minAccRho`,
`maxAccRho`,
`minDDelta`,
`maxDDelta`,
`maxAccAbsWtVega`,
`minAccWtVega`,
`maxAccWtVega`,
`minIndWtVega`,
`maxIndWtVega`,
`minSubWtVega`,
`maxSubWtVega`,
`minGrpWtVega`,
`maxGrpWtVega`,
`userText`,
`timestamp`
FROM `SRControl`.`MsgBookControl`
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
UPDATE TABLE EXAMPLE QUERY
UPDATE `SRControl`.`MsgBookControl`
SET
/* Replace with a ENUM('Hold','TwoWay','BuyOnly','SellOnly','CloseOnly','CloseNow','CloseRisk','BuyCloseOnly','SellCloseOnly') */
`bookStatus` = 'TwoWay',
/* Replace with a FLOAT */
`bookRiskMultiplier` = 1.23,
/* Replace with a FLOAT */
`maxAccHaircut` = 1.23,
/* Replace with a FLOAT */
`minAccRho` = 1.23,
/* Replace with a FLOAT */
`maxAccRho` = 1.23,
/* Replace with a INT */
`minDDelta` = 5,
/* Replace with a INT */
`maxDDelta` = 5,
/* Replace with a FLOAT */
`maxAccAbsWtVega` = 1.23,
/* Replace with a FLOAT */
`minAccWtVega` = 1.23,
/* Replace with a FLOAT */
`maxAccWtVega` = 1.23,
/* Replace with a FLOAT */
`minIndWtVega` = 1.23,
/* Replace with a FLOAT */
`maxIndWtVega` = 1.23,
/* Replace with a FLOAT */
`minSubWtVega` = 1.23,
/* Replace with a FLOAT */
`maxSubWtVega` = 1.23,
/* Replace with a FLOAT */
`minGrpWtVega` = 1.23,
/* Replace with a FLOAT */
`maxGrpWtVega` = 1.23,
/* Replace with a TINYTEXT */
`userText` = 'dummy tiny text',
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
INSERT TABLE EXAMPLE QUERY
INSERT INTO `SRControl`.`MsgBookControl`(
/* Replace with a VARCHAR(16) */
`accnt`,
/* Replace with a VARCHAR(16) */
`clientFirm`,
/* Replace with a ENUM('Hold','TwoWay','BuyOnly','SellOnly','CloseOnly','CloseNow','CloseRisk','BuyCloseOnly','SellCloseOnly') */
`bookStatus`,
/* Replace with a FLOAT */
`bookRiskMultiplier`,
/* Replace with a FLOAT */
`maxAccHaircut`,
/* Replace with a FLOAT */
`minAccRho`,
/* Replace with a FLOAT */
`maxAccRho`,
/* Replace with a INT */
`minDDelta`,
/* Replace with a INT */
`maxDDelta`,
/* Replace with a FLOAT */
`maxAccAbsWtVega`,
/* Replace with a FLOAT */
`minAccWtVega`,
/* Replace with a FLOAT */
`maxAccWtVega`,
/* Replace with a FLOAT */
`minIndWtVega`,
/* Replace with a FLOAT */
`maxIndWtVega`,
/* Replace with a FLOAT */
`minSubWtVega`,
/* Replace with a FLOAT */
`maxSubWtVega`,
/* Replace with a FLOAT */
`minGrpWtVega`,
/* Replace with a FLOAT */
`maxGrpWtVega`,
/* Replace with a TINYTEXT */
`userText`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_accnt',
'Example_clientFirm',
'TwoWay',
1.23,
1.23,
1.23,
1.23,
5,
5,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
'dummy tiny text',
'2022-01-01 12:34:56.000000'
);
DELETE TABLE EXAMPLE QUERY
DELETE FROM `SRControl`.`MsgBookControl`
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
Doc Columns Query
SELECT * FROM SRControl.doccolumns WHERE TABLE_NAME='BookControl' ORDER BY ordinal_position ASC;